{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Ex2 - Filtering and Sorting Data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This time we are going to pull data directly from the internet.\n",
    "\n",
    "### Step 1. Import the necessary libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:25:02.695430Z",
     "start_time": "2024-01-11T12:25:02.071994Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 2. Import the dataset from this [address](https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/02_Filtering_%26_Sorting/Euro12/Euro_2012_stats_TEAM.csv). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 3. Assign it to a variable called euro12."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:25:30.867693Z",
     "start_time": "2024-01-11T12:25:30.152768Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "                   Team  Goals  Shots on target  Shots off target  \\\n0               Croatia      4               13                12   \n1        Czech Republic      4               13                18   \n2               Denmark      4               10                10   \n3               England      5               11                18   \n4                France      3               22                24   \n5               Germany     10               32                32   \n6                Greece      5                8                18   \n7                 Italy      6               34                45   \n8           Netherlands      2               12                36   \n9                Poland      2               15                23   \n10             Portugal      6               22                42   \n11  Republic of Ireland      1                7                12   \n12               Russia      5                9                31   \n13                Spain     12               42                33   \n14               Sweden      5               17                19   \n15              Ukraine      2                7                26   \n\n   Shooting Accuracy % Goals-to-shots  Total shots (inc. Blocked)  \\\n0              51.9%            16.0%                          32   \n1              41.9%            12.9%                          39   \n2              50.0%            20.0%                          27   \n3              50.0%            17.2%                          40   \n4              37.9%             6.5%                          65   \n5              47.8%            15.6%                          80   \n6              30.7%            19.2%                          32   \n7              43.0%             7.5%                         110   \n8              25.0%             4.1%                          60   \n9              39.4%             5.2%                          48   \n10             34.3%             9.3%                          82   \n11             36.8%             5.2%                          28   \n12             22.5%            12.5%                          59   \n13             55.9%            16.0%                         100   \n14             47.2%            13.8%                          39   \n15             21.2%             6.0%                          38   \n\n    Hit Woodwork  Penalty goals  Penalties not scored  ...  Saves made  \\\n0              0              0                     0  ...          13   \n1              0              0                     0  ...           9   \n2              1              0                     0  ...          10   \n3              0              0                     0  ...          22   \n4              1              0                     0  ...           6   \n5              2              1                     0  ...          10   \n6              1              1                     1  ...          13   \n7              2              0                     0  ...          20   \n8              2              0                     0  ...          12   \n9              0              0                     0  ...           6   \n10             6              0                     0  ...          10   \n11             0              0                     0  ...          17   \n12             2              0                     0  ...          10   \n13             0              1                     0  ...          15   \n14             3              0                     0  ...           8   \n15             0              0                     0  ...          13   \n\n    Saves-to-shots ratio  Fouls Won Fouls Conceded  Offsides  Yellow Cards  \\\n0                  81.3%         41             62         2             9   \n1                  60.1%         53             73         8             7   \n2                  66.7%         25             38         8             4   \n3                  88.1%         43             45         6             5   \n4                  54.6%         36             51         5             6   \n5                  62.6%         63             49        12             4   \n6                  65.1%         67             48        12             9   \n7                  74.1%        101             89        16            16   \n8                  70.6%         35             30         3             5   \n9                  66.7%         48             56         3             7   \n10                 71.5%         73             90        10            12   \n11                 65.4%         43             51        11             6   \n12                 77.0%         34             43         4             6   \n13                 93.8%        102             83        19            11   \n14                 61.6%         35             51         7             7   \n15                 76.5%         48             31         4             5   \n\n    Red Cards  Subs on  Subs off  Players Used  \n0           0        9         9            16  \n1           0       11        11            19  \n2           0        7         7            15  \n3           0       11        11            16  \n4           0       11        11            19  \n5           0       15        15            17  \n6           1       12        12            20  \n7           0       18        18            19  \n8           0        7         7            15  \n9           1        7         7            17  \n10          0       14        14            16  \n11          1       10        10            17  \n12          0        7         7            16  \n13          0       17        17            18  \n14          0        9         9            18  \n15          0        9         9            18  \n\n[16 rows x 35 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Goals</th>\n      <th>Shots on target</th>\n      <th>Shots off target</th>\n      <th>Shooting Accuracy</th>\n      <th>% Goals-to-shots</th>\n      <th>Total shots (inc. Blocked)</th>\n      <th>Hit Woodwork</th>\n      <th>Penalty goals</th>\n      <th>Penalties not scored</th>\n      <th>...</th>\n      <th>Saves made</th>\n      <th>Saves-to-shots ratio</th>\n      <th>Fouls Won</th>\n      <th>Fouls Conceded</th>\n      <th>Offsides</th>\n      <th>Yellow Cards</th>\n      <th>Red Cards</th>\n      <th>Subs on</th>\n      <th>Subs off</th>\n      <th>Players Used</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Croatia</td>\n      <td>4</td>\n      <td>13</td>\n      <td>12</td>\n      <td>51.9%</td>\n      <td>16.0%</td>\n      <td>32</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>13</td>\n      <td>81.3%</td>\n      <td>41</td>\n      <td>62</td>\n      <td>2</td>\n      <td>9</td>\n      <td>0</td>\n      <td>9</td>\n      <td>9</td>\n      <td>16</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Czech Republic</td>\n      <td>4</td>\n      <td>13</td>\n      <td>18</td>\n      <td>41.9%</td>\n      <td>12.9%</td>\n      <td>39</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>9</td>\n      <td>60.1%</td>\n      <td>53</td>\n      <td>73</td>\n      <td>8</td>\n      <td>7</td>\n      <td>0</td>\n      <td>11</td>\n      <td>11</td>\n      <td>19</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Denmark</td>\n      <td>4</td>\n      <td>10</td>\n      <td>10</td>\n      <td>50.0%</td>\n      <td>20.0%</td>\n      <td>27</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>10</td>\n      <td>66.7%</td>\n      <td>25</td>\n      <td>38</td>\n      <td>8</td>\n      <td>4</td>\n      <td>0</td>\n      <td>7</td>\n      <td>7</td>\n      <td>15</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>England</td>\n      <td>5</td>\n      <td>11</td>\n      <td>18</td>\n      <td>50.0%</td>\n      <td>17.2%</td>\n      <td>40</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>22</td>\n      <td>88.1%</td>\n      <td>43</td>\n      <td>45</td>\n      <td>6</td>\n      <td>5</td>\n      <td>0</td>\n      <td>11</td>\n      <td>11</td>\n      <td>16</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>France</td>\n      <td>3</td>\n      <td>22</td>\n      <td>24</td>\n      <td>37.9%</td>\n      <td>6.5%</td>\n      <td>65</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>6</td>\n      <td>54.6%</td>\n      <td>36</td>\n      <td>51</td>\n      <td>5</td>\n      <td>6</td>\n      <td>0</td>\n      <td>11</td>\n      <td>11</td>\n      <td>19</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>Germany</td>\n      <td>10</td>\n      <td>32</td>\n      <td>32</td>\n      <td>47.8%</td>\n      <td>15.6%</td>\n      <td>80</td>\n      <td>2</td>\n      <td>1</td>\n      <td>0</td>\n      <td>...</td>\n      <td>10</td>\n      <td>62.6%</td>\n      <td>63</td>\n      <td>49</td>\n      <td>12</td>\n      <td>4</td>\n      <td>0</td>\n      <td>15</td>\n      <td>15</td>\n      <td>17</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>Greece</td>\n      <td>5</td>\n      <td>8</td>\n      <td>18</td>\n      <td>30.7%</td>\n      <td>19.2%</td>\n      <td>32</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>...</td>\n      <td>13</td>\n      <td>65.1%</td>\n      <td>67</td>\n      <td>48</td>\n      <td>12</td>\n      <td>9</td>\n      <td>1</td>\n      <td>12</td>\n      <td>12</td>\n      <td>20</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Italy</td>\n      <td>6</td>\n      <td>34</td>\n      <td>45</td>\n      <td>43.0%</td>\n      <td>7.5%</td>\n      <td>110</td>\n      <td>2</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>20</td>\n      <td>74.1%</td>\n      <td>101</td>\n      <td>89</td>\n      <td>16</td>\n      <td>16</td>\n      <td>0</td>\n      <td>18</td>\n      <td>18</td>\n      <td>19</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>Netherlands</td>\n      <td>2</td>\n      <td>12</td>\n      <td>36</td>\n      <td>25.0%</td>\n      <td>4.1%</td>\n      <td>60</td>\n      <td>2</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>12</td>\n      <td>70.6%</td>\n      <td>35</td>\n      <td>30</td>\n      <td>3</td>\n      <td>5</td>\n      <td>0</td>\n      <td>7</td>\n      <td>7</td>\n      <td>15</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>Poland</td>\n      <td>2</td>\n      <td>15</td>\n      <td>23</td>\n      <td>39.4%</td>\n      <td>5.2%</td>\n      <td>48</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>6</td>\n      <td>66.7%</td>\n      <td>48</td>\n      <td>56</td>\n      <td>3</td>\n      <td>7</td>\n      <td>1</td>\n      <td>7</td>\n      <td>7</td>\n      <td>17</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>Portugal</td>\n      <td>6</td>\n      <td>22</td>\n      <td>42</td>\n      <td>34.3%</td>\n      <td>9.3%</td>\n      <td>82</td>\n      <td>6</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>10</td>\n      <td>71.5%</td>\n      <td>73</td>\n      <td>90</td>\n      <td>10</td>\n      <td>12</td>\n      <td>0</td>\n      <td>14</td>\n      <td>14</td>\n      <td>16</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>Republic of Ireland</td>\n      <td>1</td>\n      <td>7</td>\n      <td>12</td>\n      <td>36.8%</td>\n      <td>5.2%</td>\n      <td>28</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>17</td>\n      <td>65.4%</td>\n      <td>43</td>\n      <td>51</td>\n      <td>11</td>\n      <td>6</td>\n      <td>1</td>\n      <td>10</td>\n      <td>10</td>\n      <td>17</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>Russia</td>\n      <td>5</td>\n      <td>9</td>\n      <td>31</td>\n      <td>22.5%</td>\n      <td>12.5%</td>\n      <td>59</td>\n      <td>2</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>10</td>\n      <td>77.0%</td>\n      <td>34</td>\n      <td>43</td>\n      <td>4</td>\n      <td>6</td>\n      <td>0</td>\n      <td>7</td>\n      <td>7</td>\n      <td>16</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>Spain</td>\n      <td>12</td>\n      <td>42</td>\n      <td>33</td>\n      <td>55.9%</td>\n      <td>16.0%</td>\n      <td>100</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>...</td>\n      <td>15</td>\n      <td>93.8%</td>\n      <td>102</td>\n      <td>83</td>\n      <td>19</td>\n      <td>11</td>\n      <td>0</td>\n      <td>17</td>\n      <td>17</td>\n      <td>18</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>Sweden</td>\n      <td>5</td>\n      <td>17</td>\n      <td>19</td>\n      <td>47.2%</td>\n      <td>13.8%</td>\n      <td>39</td>\n      <td>3</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>8</td>\n      <td>61.6%</td>\n      <td>35</td>\n      <td>51</td>\n      <td>7</td>\n      <td>7</td>\n      <td>0</td>\n      <td>9</td>\n      <td>9</td>\n      <td>18</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>Ukraine</td>\n      <td>2</td>\n      <td>7</td>\n      <td>26</td>\n      <td>21.2%</td>\n      <td>6.0%</td>\n      <td>38</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>13</td>\n      <td>76.5%</td>\n      <td>48</td>\n      <td>31</td>\n      <td>4</td>\n      <td>5</td>\n      <td>0</td>\n      <td>9</td>\n      <td>9</td>\n      <td>18</td>\n    </tr>\n  </tbody>\n</table>\n<p>16 rows × 35 columns</p>\n</div>"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12 = pd.read_csv(\"https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/02_Filtering_%26_Sorting/Euro12/Euro_2012_stats_TEAM.csv\")\n",
    "euro12"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 4. Select only the Goal column."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:25:46.019049Z",
     "start_time": "2024-01-11T12:25:46.005587Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "0      4\n1      4\n2      4\n3      5\n4      3\n5     10\n6      5\n7      6\n8      2\n9      2\n10     6\n11     1\n12     5\n13    12\n14     5\n15     2\nName: Goals, dtype: int64"
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.Goals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 5. How many team participated in the Euro2012?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:25:59.758207Z",
     "start_time": "2024-01-11T12:25:59.748152Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "16"
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.shape[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 6. What is the number of columns in the dataset?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:26:10.161867Z",
     "start_time": "2024-01-11T12:26:10.142138Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 16 entries, 0 to 15\n",
      "Data columns (total 35 columns):\n",
      " #   Column                      Non-Null Count  Dtype  \n",
      "---  ------                      --------------  -----  \n",
      " 0   Team                        16 non-null     object \n",
      " 1   Goals                       16 non-null     int64  \n",
      " 2   Shots on target             16 non-null     int64  \n",
      " 3   Shots off target            16 non-null     int64  \n",
      " 4   Shooting Accuracy           16 non-null     object \n",
      " 5   % Goals-to-shots            16 non-null     object \n",
      " 6   Total shots (inc. Blocked)  16 non-null     int64  \n",
      " 7   Hit Woodwork                16 non-null     int64  \n",
      " 8   Penalty goals               16 non-null     int64  \n",
      " 9   Penalties not scored        16 non-null     int64  \n",
      " 10  Headed goals                16 non-null     int64  \n",
      " 11  Passes                      16 non-null     int64  \n",
      " 12  Passes completed            16 non-null     int64  \n",
      " 13  Passing Accuracy            16 non-null     object \n",
      " 14  Touches                     16 non-null     int64  \n",
      " 15  Crosses                     16 non-null     int64  \n",
      " 16  Dribbles                    16 non-null     int64  \n",
      " 17  Corners Taken               16 non-null     int64  \n",
      " 18  Tackles                     16 non-null     int64  \n",
      " 19  Clearances                  16 non-null     int64  \n",
      " 20  Interceptions               16 non-null     int64  \n",
      " 21  Clearances off line         15 non-null     float64\n",
      " 22  Clean Sheets                16 non-null     int64  \n",
      " 23  Blocks                      16 non-null     int64  \n",
      " 24  Goals conceded              16 non-null     int64  \n",
      " 25  Saves made                  16 non-null     int64  \n",
      " 26  Saves-to-shots ratio        16 non-null     object \n",
      " 27  Fouls Won                   16 non-null     int64  \n",
      " 28  Fouls Conceded              16 non-null     int64  \n",
      " 29  Offsides                    16 non-null     int64  \n",
      " 30  Yellow Cards                16 non-null     int64  \n",
      " 31  Red Cards                   16 non-null     int64  \n",
      " 32  Subs on                     16 non-null     int64  \n",
      " 33  Subs off                    16 non-null     int64  \n",
      " 34  Players Used                16 non-null     int64  \n",
      "dtypes: float64(1), int64(29), object(5)\n",
      "memory usage: 4.5+ KB\n"
     ]
    }
   ],
   "source": [
    "euro12.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 7. View only the columns Team, Yellow Cards and Red Cards and assign them to a dataframe called discipline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:27:06.132947Z",
     "start_time": "2024-01-11T12:27:06.113742Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "                   Team  Yellow Cards  Red Cards\n0               Croatia             9          0\n1        Czech Republic             7          0\n2               Denmark             4          0\n3               England             5          0\n4                France             6          0\n5               Germany             4          0\n6                Greece             9          1\n7                 Italy            16          0\n8           Netherlands             5          0\n9                Poland             7          1\n10             Portugal            12          0\n11  Republic of Ireland             6          1\n12               Russia             6          0\n13                Spain            11          0\n14               Sweden             7          0\n15              Ukraine             5          0",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Yellow Cards</th>\n      <th>Red Cards</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Croatia</td>\n      <td>9</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Czech Republic</td>\n      <td>7</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Denmark</td>\n      <td>4</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>England</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>France</td>\n      <td>6</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>Germany</td>\n      <td>4</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>Greece</td>\n      <td>9</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Italy</td>\n      <td>16</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>Netherlands</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>Poland</td>\n      <td>7</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>Portugal</td>\n      <td>12</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>Republic of Ireland</td>\n      <td>6</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>Russia</td>\n      <td>6</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>Spain</td>\n      <td>11</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>Sweden</td>\n      <td>7</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>Ukraine</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "discipline = euro12[['Team','Yellow Cards','Red Cards']]\n",
    "discipline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 8. Sort the teams by Red Cards, then to Yellow Cards"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false,
    "scrolled": true,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:28:57.450765Z",
     "start_time": "2024-01-11T12:28:57.436663Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "                   Team  Yellow Cards  Red Cards\n6                Greece             9          1\n9                Poland             7          1\n11  Republic of Ireland             6          1\n7                 Italy            16          0\n10             Portugal            12          0\n13                Spain            11          0\n0               Croatia             9          0\n1        Czech Republic             7          0\n14               Sweden             7          0\n4                France             6          0\n12               Russia             6          0\n3               England             5          0\n8           Netherlands             5          0\n15              Ukraine             5          0\n2               Denmark             4          0\n5               Germany             4          0",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Yellow Cards</th>\n      <th>Red Cards</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>6</th>\n      <td>Greece</td>\n      <td>9</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>Poland</td>\n      <td>7</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>Republic of Ireland</td>\n      <td>6</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Italy</td>\n      <td>16</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>Portugal</td>\n      <td>12</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>Spain</td>\n      <td>11</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>0</th>\n      <td>Croatia</td>\n      <td>9</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Czech Republic</td>\n      <td>7</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>Sweden</td>\n      <td>7</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>France</td>\n      <td>6</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>Russia</td>\n      <td>6</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>England</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>Netherlands</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>Ukraine</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Denmark</td>\n      <td>4</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>Germany</td>\n      <td>4</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "discipline_sort = discipline.sort_values([\"Red Cards\",\"Yellow Cards\"], ascending= False)\n",
    "discipline_sort"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 9. Calculate the mean Yellow Cards given per Team"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:30:48.350194Z",
     "start_time": "2024-01-11T12:30:48.337256Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "7"
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "round(discipline_sort['Yellow Cards'].mean())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 10. Filter teams that scored more than 6 goals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:31:18.384589Z",
     "start_time": "2024-01-11T12:31:18.354127Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "       Team  Goals  Shots on target  Shots off target Shooting Accuracy  \\\n5   Germany     10               32                32             47.8%   \n13    Spain     12               42                33             55.9%   \n\n   % Goals-to-shots  Total shots (inc. Blocked)  Hit Woodwork  Penalty goals  \\\n5             15.6%                          80             2              1   \n13            16.0%                         100             0              1   \n\n    Penalties not scored  ...  Saves made  Saves-to-shots ratio  Fouls Won  \\\n5                      0  ...          10                 62.6%         63   \n13                     0  ...          15                 93.8%        102   \n\n   Fouls Conceded  Offsides  Yellow Cards  Red Cards  Subs on  Subs off  \\\n5              49        12             4          0       15        15   \n13             83        19            11          0       17        17   \n\n    Players Used  \n5             17  \n13            18  \n\n[2 rows x 35 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Goals</th>\n      <th>Shots on target</th>\n      <th>Shots off target</th>\n      <th>Shooting Accuracy</th>\n      <th>% Goals-to-shots</th>\n      <th>Total shots (inc. Blocked)</th>\n      <th>Hit Woodwork</th>\n      <th>Penalty goals</th>\n      <th>Penalties not scored</th>\n      <th>...</th>\n      <th>Saves made</th>\n      <th>Saves-to-shots ratio</th>\n      <th>Fouls Won</th>\n      <th>Fouls Conceded</th>\n      <th>Offsides</th>\n      <th>Yellow Cards</th>\n      <th>Red Cards</th>\n      <th>Subs on</th>\n      <th>Subs off</th>\n      <th>Players Used</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>5</th>\n      <td>Germany</td>\n      <td>10</td>\n      <td>32</td>\n      <td>32</td>\n      <td>47.8%</td>\n      <td>15.6%</td>\n      <td>80</td>\n      <td>2</td>\n      <td>1</td>\n      <td>0</td>\n      <td>...</td>\n      <td>10</td>\n      <td>62.6%</td>\n      <td>63</td>\n      <td>49</td>\n      <td>12</td>\n      <td>4</td>\n      <td>0</td>\n      <td>15</td>\n      <td>15</td>\n      <td>17</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>Spain</td>\n      <td>12</td>\n      <td>42</td>\n      <td>33</td>\n      <td>55.9%</td>\n      <td>16.0%</td>\n      <td>100</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>...</td>\n      <td>15</td>\n      <td>93.8%</td>\n      <td>102</td>\n      <td>83</td>\n      <td>19</td>\n      <td>11</td>\n      <td>0</td>\n      <td>17</td>\n      <td>17</td>\n      <td>18</td>\n    </tr>\n  </tbody>\n</table>\n<p>2 rows × 35 columns</p>\n</div>"
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12[euro12['Goals'] > 6]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 11. Select the teams that start with G"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:32:31.476922Z",
     "start_time": "2024-01-11T12:32:31.465331Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "      Team  Goals  Shots on target  Shots off target Shooting Accuracy  \\\n5  Germany     10               32                32             47.8%   \n6   Greece      5                8                18             30.7%   \n\n  % Goals-to-shots  Total shots (inc. Blocked)  Hit Woodwork  Penalty goals  \\\n5            15.6%                          80             2              1   \n6            19.2%                          32             1              1   \n\n   Penalties not scored  ...  Saves made  Saves-to-shots ratio  Fouls Won  \\\n5                     0  ...          10                 62.6%         63   \n6                     1  ...          13                 65.1%         67   \n\n  Fouls Conceded  Offsides  Yellow Cards  Red Cards  Subs on  Subs off  \\\n5             49        12             4          0       15        15   \n6             48        12             9          1       12        12   \n\n   Players Used  \n5            17  \n6            20  \n\n[2 rows x 35 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Goals</th>\n      <th>Shots on target</th>\n      <th>Shots off target</th>\n      <th>Shooting Accuracy</th>\n      <th>% Goals-to-shots</th>\n      <th>Total shots (inc. Blocked)</th>\n      <th>Hit Woodwork</th>\n      <th>Penalty goals</th>\n      <th>Penalties not scored</th>\n      <th>...</th>\n      <th>Saves made</th>\n      <th>Saves-to-shots ratio</th>\n      <th>Fouls Won</th>\n      <th>Fouls Conceded</th>\n      <th>Offsides</th>\n      <th>Yellow Cards</th>\n      <th>Red Cards</th>\n      <th>Subs on</th>\n      <th>Subs off</th>\n      <th>Players Used</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>5</th>\n      <td>Germany</td>\n      <td>10</td>\n      <td>32</td>\n      <td>32</td>\n      <td>47.8%</td>\n      <td>15.6%</td>\n      <td>80</td>\n      <td>2</td>\n      <td>1</td>\n      <td>0</td>\n      <td>...</td>\n      <td>10</td>\n      <td>62.6%</td>\n      <td>63</td>\n      <td>49</td>\n      <td>12</td>\n      <td>4</td>\n      <td>0</td>\n      <td>15</td>\n      <td>15</td>\n      <td>17</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>Greece</td>\n      <td>5</td>\n      <td>8</td>\n      <td>18</td>\n      <td>30.7%</td>\n      <td>19.2%</td>\n      <td>32</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>...</td>\n      <td>13</td>\n      <td>65.1%</td>\n      <td>67</td>\n      <td>48</td>\n      <td>12</td>\n      <td>9</td>\n      <td>1</td>\n      <td>12</td>\n      <td>12</td>\n      <td>20</td>\n    </tr>\n  </tbody>\n</table>\n<p>2 rows × 35 columns</p>\n</div>"
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12[euro12.Team.str.startswith(\"G\")]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 12. Select the first 7 columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:33:49.725133Z",
     "start_time": "2024-01-11T12:33:49.698057Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "                   Team  Goals  Shots on target  Shots off target  \\\n0               Croatia      4               13                12   \n1        Czech Republic      4               13                18   \n2               Denmark      4               10                10   \n3               England      5               11                18   \n4                France      3               22                24   \n5               Germany     10               32                32   \n6                Greece      5                8                18   \n7                 Italy      6               34                45   \n8           Netherlands      2               12                36   \n9                Poland      2               15                23   \n10             Portugal      6               22                42   \n11  Republic of Ireland      1                7                12   \n12               Russia      5                9                31   \n13                Spain     12               42                33   \n14               Sweden      5               17                19   \n15              Ukraine      2                7                26   \n\n   Shooting Accuracy % Goals-to-shots  Total shots (inc. Blocked)  \n0              51.9%            16.0%                          32  \n1              41.9%            12.9%                          39  \n2              50.0%            20.0%                          27  \n3              50.0%            17.2%                          40  \n4              37.9%             6.5%                          65  \n5              47.8%            15.6%                          80  \n6              30.7%            19.2%                          32  \n7              43.0%             7.5%                         110  \n8              25.0%             4.1%                          60  \n9              39.4%             5.2%                          48  \n10             34.3%             9.3%                          82  \n11             36.8%             5.2%                          28  \n12             22.5%            12.5%                          59  \n13             55.9%            16.0%                         100  \n14             47.2%            13.8%                          39  \n15             21.2%             6.0%                          38  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Goals</th>\n      <th>Shots on target</th>\n      <th>Shots off target</th>\n      <th>Shooting Accuracy</th>\n      <th>% Goals-to-shots</th>\n      <th>Total shots (inc. Blocked)</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Croatia</td>\n      <td>4</td>\n      <td>13</td>\n      <td>12</td>\n      <td>51.9%</td>\n      <td>16.0%</td>\n      <td>32</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Czech Republic</td>\n      <td>4</td>\n      <td>13</td>\n      <td>18</td>\n      <td>41.9%</td>\n      <td>12.9%</td>\n      <td>39</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Denmark</td>\n      <td>4</td>\n      <td>10</td>\n      <td>10</td>\n      <td>50.0%</td>\n      <td>20.0%</td>\n      <td>27</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>England</td>\n      <td>5</td>\n      <td>11</td>\n      <td>18</td>\n      <td>50.0%</td>\n      <td>17.2%</td>\n      <td>40</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>France</td>\n      <td>3</td>\n      <td>22</td>\n      <td>24</td>\n      <td>37.9%</td>\n      <td>6.5%</td>\n      <td>65</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>Germany</td>\n      <td>10</td>\n      <td>32</td>\n      <td>32</td>\n      <td>47.8%</td>\n      <td>15.6%</td>\n      <td>80</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>Greece</td>\n      <td>5</td>\n      <td>8</td>\n      <td>18</td>\n      <td>30.7%</td>\n      <td>19.2%</td>\n      <td>32</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Italy</td>\n      <td>6</td>\n      <td>34</td>\n      <td>45</td>\n      <td>43.0%</td>\n      <td>7.5%</td>\n      <td>110</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>Netherlands</td>\n      <td>2</td>\n      <td>12</td>\n      <td>36</td>\n      <td>25.0%</td>\n      <td>4.1%</td>\n      <td>60</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>Poland</td>\n      <td>2</td>\n      <td>15</td>\n      <td>23</td>\n      <td>39.4%</td>\n      <td>5.2%</td>\n      <td>48</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>Portugal</td>\n      <td>6</td>\n      <td>22</td>\n      <td>42</td>\n      <td>34.3%</td>\n      <td>9.3%</td>\n      <td>82</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>Republic of Ireland</td>\n      <td>1</td>\n      <td>7</td>\n      <td>12</td>\n      <td>36.8%</td>\n      <td>5.2%</td>\n      <td>28</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>Russia</td>\n      <td>5</td>\n      <td>9</td>\n      <td>31</td>\n      <td>22.5%</td>\n      <td>12.5%</td>\n      <td>59</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>Spain</td>\n      <td>12</td>\n      <td>42</td>\n      <td>33</td>\n      <td>55.9%</td>\n      <td>16.0%</td>\n      <td>100</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>Sweden</td>\n      <td>5</td>\n      <td>17</td>\n      <td>19</td>\n      <td>47.2%</td>\n      <td>13.8%</td>\n      <td>39</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>Ukraine</td>\n      <td>2</td>\n      <td>7</td>\n      <td>26</td>\n      <td>21.2%</td>\n      <td>6.0%</td>\n      <td>38</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.iloc[:,0:7]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 13. Select all columns except the last 3."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:34:23.839290Z",
     "start_time": "2024-01-11T12:34:23.829561Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "                   Team  Goals  Shots on target  Shots off target  \\\n0               Croatia      4               13                12   \n1        Czech Republic      4               13                18   \n2               Denmark      4               10                10   \n3               England      5               11                18   \n4                France      3               22                24   \n5               Germany     10               32                32   \n6                Greece      5                8                18   \n7                 Italy      6               34                45   \n8           Netherlands      2               12                36   \n9                Poland      2               15                23   \n10             Portugal      6               22                42   \n11  Republic of Ireland      1                7                12   \n12               Russia      5                9                31   \n13                Spain     12               42                33   \n14               Sweden      5               17                19   \n15              Ukraine      2                7                26   \n\n   Shooting Accuracy % Goals-to-shots  Total shots (inc. Blocked)  \\\n0              51.9%            16.0%                          32   \n1              41.9%            12.9%                          39   \n2              50.0%            20.0%                          27   \n3              50.0%            17.2%                          40   \n4              37.9%             6.5%                          65   \n5              47.8%            15.6%                          80   \n6              30.7%            19.2%                          32   \n7              43.0%             7.5%                         110   \n8              25.0%             4.1%                          60   \n9              39.4%             5.2%                          48   \n10             34.3%             9.3%                          82   \n11             36.8%             5.2%                          28   \n12             22.5%            12.5%                          59   \n13             55.9%            16.0%                         100   \n14             47.2%            13.8%                          39   \n15             21.2%             6.0%                          38   \n\n    Hit Woodwork  Penalty goals  Penalties not scored  ...  Clean Sheets  \\\n0              0              0                     0  ...             0   \n1              0              0                     0  ...             1   \n2              1              0                     0  ...             1   \n3              0              0                     0  ...             2   \n4              1              0                     0  ...             1   \n5              2              1                     0  ...             1   \n6              1              1                     1  ...             1   \n7              2              0                     0  ...             2   \n8              2              0                     0  ...             0   \n9              0              0                     0  ...             0   \n10             6              0                     0  ...             2   \n11             0              0                     0  ...             0   \n12             2              0                     0  ...             0   \n13             0              1                     0  ...             5   \n14             3              0                     0  ...             1   \n15             0              0                     0  ...             0   \n\n    Blocks  Goals conceded Saves made  Saves-to-shots ratio  Fouls Won  \\\n0       10               3         13                 81.3%         41   \n1       10               6          9                 60.1%         53   \n2       10               5         10                 66.7%         25   \n3       29               3         22                 88.1%         43   \n4        7               5          6                 54.6%         36   \n5       11               6         10                 62.6%         63   \n6       23               7         13                 65.1%         67   \n7       18               7         20                 74.1%        101   \n8        9               5         12                 70.6%         35   \n9        8               3          6                 66.7%         48   \n10      11               4         10                 71.5%         73   \n11      23               9         17                 65.4%         43   \n12       8               3         10                 77.0%         34   \n13       8               1         15                 93.8%        102   \n14      12               5          8                 61.6%         35   \n15       4               4         13                 76.5%         48   \n\n    Fouls Conceded  Offsides  Yellow Cards  Red Cards  \n0               62         2             9          0  \n1               73         8             7          0  \n2               38         8             4          0  \n3               45         6             5          0  \n4               51         5             6          0  \n5               49        12             4          0  \n6               48        12             9          1  \n7               89        16            16          0  \n8               30         3             5          0  \n9               56         3             7          1  \n10              90        10            12          0  \n11              51        11             6          1  \n12              43         4             6          0  \n13              83        19            11          0  \n14              51         7             7          0  \n15              31         4             5          0  \n\n[16 rows x 32 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Goals</th>\n      <th>Shots on target</th>\n      <th>Shots off target</th>\n      <th>Shooting Accuracy</th>\n      <th>% Goals-to-shots</th>\n      <th>Total shots (inc. Blocked)</th>\n      <th>Hit Woodwork</th>\n      <th>Penalty goals</th>\n      <th>Penalties not scored</th>\n      <th>...</th>\n      <th>Clean Sheets</th>\n      <th>Blocks</th>\n      <th>Goals conceded</th>\n      <th>Saves made</th>\n      <th>Saves-to-shots ratio</th>\n      <th>Fouls Won</th>\n      <th>Fouls Conceded</th>\n      <th>Offsides</th>\n      <th>Yellow Cards</th>\n      <th>Red Cards</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>Croatia</td>\n      <td>4</td>\n      <td>13</td>\n      <td>12</td>\n      <td>51.9%</td>\n      <td>16.0%</td>\n      <td>32</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>0</td>\n      <td>10</td>\n      <td>3</td>\n      <td>13</td>\n      <td>81.3%</td>\n      <td>41</td>\n      <td>62</td>\n      <td>2</td>\n      <td>9</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>Czech Republic</td>\n      <td>4</td>\n      <td>13</td>\n      <td>18</td>\n      <td>41.9%</td>\n      <td>12.9%</td>\n      <td>39</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>1</td>\n      <td>10</td>\n      <td>6</td>\n      <td>9</td>\n      <td>60.1%</td>\n      <td>53</td>\n      <td>73</td>\n      <td>8</td>\n      <td>7</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>Denmark</td>\n      <td>4</td>\n      <td>10</td>\n      <td>10</td>\n      <td>50.0%</td>\n      <td>20.0%</td>\n      <td>27</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>1</td>\n      <td>10</td>\n      <td>5</td>\n      <td>10</td>\n      <td>66.7%</td>\n      <td>25</td>\n      <td>38</td>\n      <td>8</td>\n      <td>4</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>England</td>\n      <td>5</td>\n      <td>11</td>\n      <td>18</td>\n      <td>50.0%</td>\n      <td>17.2%</td>\n      <td>40</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>2</td>\n      <td>29</td>\n      <td>3</td>\n      <td>22</td>\n      <td>88.1%</td>\n      <td>43</td>\n      <td>45</td>\n      <td>6</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>France</td>\n      <td>3</td>\n      <td>22</td>\n      <td>24</td>\n      <td>37.9%</td>\n      <td>6.5%</td>\n      <td>65</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>1</td>\n      <td>7</td>\n      <td>5</td>\n      <td>6</td>\n      <td>54.6%</td>\n      <td>36</td>\n      <td>51</td>\n      <td>5</td>\n      <td>6</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>Germany</td>\n      <td>10</td>\n      <td>32</td>\n      <td>32</td>\n      <td>47.8%</td>\n      <td>15.6%</td>\n      <td>80</td>\n      <td>2</td>\n      <td>1</td>\n      <td>0</td>\n      <td>...</td>\n      <td>1</td>\n      <td>11</td>\n      <td>6</td>\n      <td>10</td>\n      <td>62.6%</td>\n      <td>63</td>\n      <td>49</td>\n      <td>12</td>\n      <td>4</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>Greece</td>\n      <td>5</td>\n      <td>8</td>\n      <td>18</td>\n      <td>30.7%</td>\n      <td>19.2%</td>\n      <td>32</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>...</td>\n      <td>1</td>\n      <td>23</td>\n      <td>7</td>\n      <td>13</td>\n      <td>65.1%</td>\n      <td>67</td>\n      <td>48</td>\n      <td>12</td>\n      <td>9</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Italy</td>\n      <td>6</td>\n      <td>34</td>\n      <td>45</td>\n      <td>43.0%</td>\n      <td>7.5%</td>\n      <td>110</td>\n      <td>2</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>2</td>\n      <td>18</td>\n      <td>7</td>\n      <td>20</td>\n      <td>74.1%</td>\n      <td>101</td>\n      <td>89</td>\n      <td>16</td>\n      <td>16</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>Netherlands</td>\n      <td>2</td>\n      <td>12</td>\n      <td>36</td>\n      <td>25.0%</td>\n      <td>4.1%</td>\n      <td>60</td>\n      <td>2</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>0</td>\n      <td>9</td>\n      <td>5</td>\n      <td>12</td>\n      <td>70.6%</td>\n      <td>35</td>\n      <td>30</td>\n      <td>3</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>Poland</td>\n      <td>2</td>\n      <td>15</td>\n      <td>23</td>\n      <td>39.4%</td>\n      <td>5.2%</td>\n      <td>48</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>0</td>\n      <td>8</td>\n      <td>3</td>\n      <td>6</td>\n      <td>66.7%</td>\n      <td>48</td>\n      <td>56</td>\n      <td>3</td>\n      <td>7</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>Portugal</td>\n      <td>6</td>\n      <td>22</td>\n      <td>42</td>\n      <td>34.3%</td>\n      <td>9.3%</td>\n      <td>82</td>\n      <td>6</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>2</td>\n      <td>11</td>\n      <td>4</td>\n      <td>10</td>\n      <td>71.5%</td>\n      <td>73</td>\n      <td>90</td>\n      <td>10</td>\n      <td>12</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>Republic of Ireland</td>\n      <td>1</td>\n      <td>7</td>\n      <td>12</td>\n      <td>36.8%</td>\n      <td>5.2%</td>\n      <td>28</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>0</td>\n      <td>23</td>\n      <td>9</td>\n      <td>17</td>\n      <td>65.4%</td>\n      <td>43</td>\n      <td>51</td>\n      <td>11</td>\n      <td>6</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>Russia</td>\n      <td>5</td>\n      <td>9</td>\n      <td>31</td>\n      <td>22.5%</td>\n      <td>12.5%</td>\n      <td>59</td>\n      <td>2</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>0</td>\n      <td>8</td>\n      <td>3</td>\n      <td>10</td>\n      <td>77.0%</td>\n      <td>34</td>\n      <td>43</td>\n      <td>4</td>\n      <td>6</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>Spain</td>\n      <td>12</td>\n      <td>42</td>\n      <td>33</td>\n      <td>55.9%</td>\n      <td>16.0%</td>\n      <td>100</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>...</td>\n      <td>5</td>\n      <td>8</td>\n      <td>1</td>\n      <td>15</td>\n      <td>93.8%</td>\n      <td>102</td>\n      <td>83</td>\n      <td>19</td>\n      <td>11</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>Sweden</td>\n      <td>5</td>\n      <td>17</td>\n      <td>19</td>\n      <td>47.2%</td>\n      <td>13.8%</td>\n      <td>39</td>\n      <td>3</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>1</td>\n      <td>12</td>\n      <td>5</td>\n      <td>8</td>\n      <td>61.6%</td>\n      <td>35</td>\n      <td>51</td>\n      <td>7</td>\n      <td>7</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>Ukraine</td>\n      <td>2</td>\n      <td>7</td>\n      <td>26</td>\n      <td>21.2%</td>\n      <td>6.0%</td>\n      <td>38</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>...</td>\n      <td>0</td>\n      <td>4</td>\n      <td>4</td>\n      <td>13</td>\n      <td>76.5%</td>\n      <td>48</td>\n      <td>31</td>\n      <td>4</td>\n      <td>5</td>\n      <td>0</td>\n    </tr>\n  </tbody>\n</table>\n<p>16 rows × 32 columns</p>\n</div>"
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.iloc[:,:-3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 14. Present only the Shooting Accuracy from England, Italy and Russia"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2024-01-11T12:37:17.671090Z",
     "start_time": "2024-01-11T12:37:17.646423Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "       Team Shooting Accuracy\n3   England             50.0%\n7     Italy             43.0%\n12   Russia             22.5%",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Team</th>\n      <th>Shooting Accuracy</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>3</th>\n      <td>England</td>\n      <td>50.0%</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>Italy</td>\n      <td>43.0%</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>Russia</td>\n      <td>22.5%</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.loc[euro12['Team'].isin([\"England\",\"Italy\",\"Russia\"]),[\"Team\",\"Shooting Accuracy\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "name": "python3",
   "language": "python",
   "display_name": "Python 3 (ipykernel)"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
